<%@ page pageEncoding="utf-8" %>
<%@include file="/commons/taglibs.jsp" %>
<!DOCTYPE html>
<html>
<fmt:bundle basename="res">
<head>
    <meta charset="utf-8">
    <title></title>
    <jsp:include page="/WEB-INF/commons/commons-header.jsp" flush="true"/>
    <style>
        html {
            background: #fff;
        }
    </style>
</head>

<body>
<div class="layui-container">
    <div class="layui-form" lay-filter="layuiadmin-app-form-list" id="layuiadmin-app-form-list" style="padding: 20px 30px 0 0;">

        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
            <legend><fmt:message key='zbjxx'/></legend>
        </fieldset>

        <div class="layui-form-item">
            <label class="layui-form-label"><fmt:message key='zjbid'/></label>
            <div class="layui-form-mid layui-word-aux">${webUser.liveID}</div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label"><fmt:message key='zbjmc'/></label>
            <div class="layui-form-mid layui-word-aux">
                ${webUser.liveName}
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label"><fmt:message key='zbjms'/></label>
            <div class="layui-form-mid layui-word-aux">
                ${webUser.liveIntroduce}
            </div>
        </div>

        <div class="layui-form-item goodsChannelArea">
            <label class="layui-form-label"><fmt:message key='cjsj'/></label>
            <div class="layui-form-mid layui-word-aux">
                <fmt:formatDate value="${webUser.createTime}" type="both"/>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label"><fmt:message key='zbtp'/></label>
            <div class="layui-form-mid layui-word-aux">
                <img src="${store_domain}/uploads/${webUser.liveImage}" class="perview" style="max-height: 240px">
            </div>
        </div>

        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
            <legend><fmt:message key='fzrxx'/></legend>
        </fieldset>

        <div class="layui-form-item">
            <label class="layui-form-label"><fmt:message key='fzrmc'/></label>
            <div class="layui-form-mid layui-word-aux">
                ${webUser.realName}
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label"><fmt:message key='fzrsjh'/></label>
            <div class="layui-form-mid layui-word-aux">
                ${webUser.mobile}
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label"><fmt:message key='fzrsfzhm'/></label>
            <div class="layui-form-mid layui-word-aux">
                ${webUser.liveIdCardNo}
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label"><fmt:message key='sfzzm'/></label>
            <div class="layui-form-mid layui-word-aux">
                <img src="${store_domain}/uploads/${webUser.liveIdCardFront}" class="perview" style="max-height: 240px">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label"><fmt:message key='sfzfm'/></label>
            <div class="layui-form-mid layui-word-aux">
                <img src="${store_domain}/uploads/${webUser.liveIdCardReverse}" class="perview" style="max-height: 240px">
            </div>
        </div>

        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
            <legend><fmt:message key='gzryxx'/></legend>
        </fieldset>

        <table class="layui-table" lay-size="sm">
            <thead>
            <tr>
                <th><fmt:message key='xm'/></th>
                <th><fmt:message key='sjh'/></th>
                <th><fmt:message key='sf'/></th>
                <th><fmt:message key='zt'/></th>
                <th><fmt:message key='cz'/></th>
            </tr>
            </thead>
            <tbody>
            <c:forEach var="item" items="${emp}">
                <tr>
                    <td>${item.realName}</td>
                    <td>${item.mobile}</td>
                    <td>
                        <c:if test="${item.anchor == null}"><fmt:message key='zb'/></c:if>
                        <c:if test="${item.anchor != null}"><fmt:message key='zl'/></c:if>
                    </td>
                    <td>
                        <c:if test="${item.accountNonLocked}"><fmt:message key='qy'/></c:if>
                        <c:if test="${!item.accountNonLocked}"><fmt:message key='jy'/></c:if>
                    </td>
                    <td>
                        <c:if test="${item.accountNonLocked}">
                            <a href="javascript:void(0);" data-id="${item.id}" class="layui-btn layui-btn-danger layui-btn-xs locked"><fmt:message key='jy'/></a>
                        </c:if>
                        <c:if test="${!item.accountNonLocked}">
                            <a href="javascript:void(0);" data-id="${item.id}" class="layui-btn layui-btn-normal layui-btn-xs unlocked"><fmt:message key='qy'/></a>
                        </c:if>
                        <a href="javascript:void(0);" data-id="${item.id}" class="layui-btn layui-btn-normal layui-btn-xs modify-password"><fmt:message key='xgmm'/></a>
                    </td>
                </tr>
            </c:forEach>
            </tbody>
        </table>
    </div>
</div>

<script>

    layui.use("layer", function () {

        var layer = layui.layer;

        //审核
        $(".modify-password").click(function () {
            var id = $(this).attr("data-id");
            layer.open({
                type: 2,
                content: "${web_domain}/live/modifyAssistantPassword?id=" + id,
                area: ["60%", "60%"],
                btn: ["<fmt:message key='qd'/>", "<fmt:message key='qx'/>"],
                yes: function (index, layero) {
                    layero.find('iframe').contents().find("#submit").click();
                }
            });
        });

        //禁用
        $(".locked").click(function () {
            var id = $(this).attr("data-id");
            layui.use('layer', function () {
                var layer = layui.layer;
                layer.open({
                    type: 0,
                    title: '<fmt:message key='jyzh'/>',//自定义标题样式
                    border: [0],
                    content: '<span class="orange"><fmt:message key='jyhgzhjwfdl,qrjyzhm?'/></span>',
                    btn: ['<fmt:message key='jy'/>', '<fmt:message key='qx'/>'],
                    yes: function () {
                        $.ajax({
                            type: "post",
                            url: "${web_domain}/mall/member/disable",
                            dataType: "json",
                            data: {
                                "id": id,
                                "_method": "put"
                            },
                            success: function (data) {
                                location.reload();
                            }
                        });
                    },
                    no: function () {
                        layer.close(index);
                    }
                });
            });
        });

        //启用
        $(".unlocked").click(function () {
            var id = $(this).attr("data-id");
            layui.use('layer', function () {
                var layer = layui.layer;
                layer.open({
                    type: 0,
                    title: '<fmt:message key='qyzh'/>',//自定义标题样式
                    border: [0],
                    content: '<span class="orange"><fmt:message key='qdhfgzhzcsym?'/></span>',
                    btn: ['<fmt:message key='qy'/>', '<fmt:message key='qx'/>'],
                    yes: function () {
                        $.ajax({
                            type: "post",
                            url: "${web_domain}/mall/member/enabled",
                            dataType: "json",
                            data: {
                                "id": id,
                                "_method": "put"
                            },
                            success: function (data) {
                                location.reload();
                            }
                        });
                    },
                    no: function () {
                        layer.close(index);
                    }
                });
            });
        });


    });
</script>
</body>
</fmt:bundle>
</html>